using System.IO;
using Microsoft.Practices.RecipeFramework;

namespace PrismFactory.SoftwareFactory.Extensions.Actions.OS
{
    public class CreateFolderAction : ConfigurableAction
    {
        [Input(Required = true)]
        public string FullPath { get; set; }

        // Methods
        public override void Execute()
        {
            Directory.CreateDirectory(FullPath);
        }

        public override void Undo()
        {
            if (Directory.Exists(FullPath))
            {
                Directory.Delete(FullPath);
            }
        }
    }
}